//
//  GHRecomendTableViewCell.m
//  GodHorses
//
//  Created by Mac on 2017/11/21.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "GHRecomendTableViewCell.h"
@interface GHRecomendTableViewCell()
@property(nonatomic, strong) STLabel                     *nickNameLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *allLable;
@property(nonatomic, strong) STLabel                     *percentLable;

@end
@implementation GHRecomendTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 60;
}
#pragma mark --subView
- (void)configSubView{
    
    self.nickNameLable = [self defultLableTitle:@"--" showRigthLine:YES];
    [self addSubview:self.nickNameLable];
    
    self.timeLable = [self defultLableTitle:@"--" showRigthLine:YES];
    [self addSubview:self.timeLable];
    
    self.allLable = [self defultLableTitle:@"--" showRigthLine:YES];
    [self addSubview:self.allLable];
    
    self.percentLable = [self defultLableTitle:@"--" showRigthLine:NO];
    [self addSubview:self.percentLable];
    
    self.timeLable.left = UIScreenWidth / 4;
    self.allLable.left = 2 * UIScreenWidth / 4;
    self.percentLable.left = 3*  UIScreenWidth / 4;
}

- (STLabel*)defultLableTitle:(NSString*)title showRigthLine:(BOOL)showRigthLine{
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth / 4, 50)
                                                     text:title
                                                textColor:GH_firstTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    if (showRigthLine) {
        [titleLable st_showRightLine:50];
    }
    return titleLable;
    
}
- (void)setModel:(GHRecomendModel *)model{
    _model = model;
    self.nickNameLable.text = model.mobile;
    self.timeLable.text = model.reg_time;
    self.allLable.text = model.total;
    self.percentLable.text = [NSString stringWithFormat:@"%@",model.total_percent];
    
}

@end
